<!--
	作者：779744514@qq.com
	时间：2015-08-18
	描述：简单的加减计数
-->
<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div ng-controller="FirstController">
			<h4> the simplest adding machine ever</h4>
			<button ng-click="add(1)" class="button">Add</button>
			<a ng-click="subtract(1)" class="button alert">Subtract</a>
			<h4> Current count:{{counter}}</h4>
		</div>
		<script src="js/angular.js"></script>
		<script type="text/javascript">
			var app=angular.module("myApp",[]);
			app.controller("FirstController",function($scope){
				$scope.counter=0;
				$scope.add = function(amount){
					$scope.counter+=amount;
				};
				$scope.subtract= function(amount){
					$scope.counter-=amount;
				};
			});
		</script>
	</body>
</html>
